ALTER VIEW [dbo].[View_CF_BizOption]
AS
SELECT
        bo.BizOptionGUID,
        bo.BizParamSetGUID,
        bo.BizOptionName,
        bo.BizOptionCode,
        bo.TenantId,
        bo.IsDeleted,
        bo.CreateTime,
        bo.CreateGUID,
        bo.CreatedName,
        bo.ModifiedTime,
        bo.ModifiedGUID,
        bo.ModifiedName,
        bo.ApproveState,
        bo.ApproveGUID,
        bo.ApproveTime,
        bo.BuUnitGUID,
        bo.ParentGUID,
        bo.FullCode,
        bo.OrderCode,
        bo.Icon,
	   (CASE (SELECT TOP 1 1 FROM CF_BizOption tbo WHERE tbo.ParentGUID=bo.BizParamSetGUID ) WHEN	1 THEN 0 ELSE 1 END ) AS IsEnd,
		bp.BizParamSetName,
		bp.BizParamCode
FROM dbo.CF_BizOption bo
LEFT JOIN dbo.CF_BizParamSet bp ON bp.BizParamSetGUID=bo.BizParamSetGUID